import 'package:rfid/generated/json/base/json_convert_content.dart';
import 'package:rfid/entity/setting_entity.dart';

SettingEntity $SettingEntityFromJson(Map<String, dynamic> json) {
	final SettingEntity settingEntity = SettingEntity();
	final String? apiAddr = jsonConvert.convert<String>(json['api_addr']);
	if (apiAddr != null) {
		settingEntity.apiAddr = apiAddr;
	}
	final String? picApiAddr = jsonConvert.convert<String>(json['picApiAddr']);
	if (picApiAddr != null) {
		settingEntity.picApiAddr = picApiAddr;
	}
	final String? faceApiAddr = jsonConvert.convert<String>(json['faceApiAddr']);
	if (faceApiAddr != null) {
		settingEntity.faceApiAddr = faceApiAddr;
	}
	final String? psw = jsonConvert.convert<String>(json['psw']);
	if (psw != null) {
		settingEntity.psw = psw;
	}
	final String? appKey = jsonConvert.convert<String>(json['appKey']);
	if (appKey != null) {
		settingEntity.appKey = appKey;
	}
	final String? commonUid = jsonConvert.convert<String>(json['commonUid']);
	if (commonUid != null) {
		settingEntity.commonUid = commonUid;
	}
	final String? executable = jsonConvert.convert<String>(json['executable']);
	if (executable != null) {
		settingEntity.executable = executable;
	}
	final String? analysisBook = jsonConvert.convert<String>(json['analysisBook']);
	if (analysisBook != null) {
		settingEntity.analysisBook = analysisBook;
	}
	final String? analysisReader = jsonConvert.convert<String>(json['analysisReader']);
	if (analysisReader != null) {
		settingEntity.analysisReader = analysisReader;
	}
	final String? face = jsonConvert.convert<String>(json['face']);
	if (face != null) {
		settingEntity.face = face;
	}
	final String? kdApi = jsonConvert.convert<String>(json['kdApi']);
	if (kdApi != null) {
		settingEntity.kdApi = kdApi;
	}
	final bool? isUltra = jsonConvert.convert<bool>(json['isUltra']);
	if (isUltra != null) {
		settingEntity.isUltra = isUltra;
	}
	final bool? canReturnIfOver = jsonConvert.convert<bool>(json['canReturnIfOver']);
	if (canReturnIfOver != null) {
		settingEntity.canReturnIfOver = canReturnIfOver;
	}
	final int? blockStart = jsonConvert.convert<int>(json['blockStart']);
	if (blockStart != null) {
		settingEntity.blockStart = blockStart;
	}
	final int? blockCount = jsonConvert.convert<int>(json['blockCount']);
	if (blockCount != null) {
		settingEntity.blockCount = blockCount;
	}
	final int? scanTime = jsonConvert.convert<int>(json['scanTime']);
	if (scanTime != null) {
		settingEntity.scanTime = scanTime;
	}
	final double? scale1 = jsonConvert.convert<double>(json['scale1']);
	if (scale1 != null) {
		settingEntity.scale1 = scale1;
	}
	final double? scale2 = jsonConvert.convert<double>(json['scale2']);
	if (scale2 != null) {
		settingEntity.scale2 = scale2;
	}
	final double? translateX1 = jsonConvert.convert<double>(json['translateX1']);
	if (translateX1 != null) {
		settingEntity.translateX1 = translateX1;
	}
	final double? translateX2 = jsonConvert.convert<double>(json['translateX2']);
	if (translateX2 != null) {
		settingEntity.translateX2 = translateX2;
	}
	final double? translateY1 = jsonConvert.convert<double>(json['translateY1']);
	if (translateY1 != null) {
		settingEntity.translateY1 = translateY1;
	}
	final double? translateY2 = jsonConvert.convert<double>(json['translateY2']);
	if (translateY2 != null) {
		settingEntity.translateY2 = translateY2;
	}
	final String? publishName = jsonConvert.convert<String>(json['publish_name']);
	if (publishName != null) {
		settingEntity.publishName = publishName;
	}
	final String? webSocketAddr = jsonConvert.convert<String>(json['web_socket_addr']);
	if (webSocketAddr != null) {
		settingEntity.webSocketAddr = webSocketAddr;
	}
	final List<SettingEntityReader>? reader = jsonConvert.convertListNotNull<SettingEntityReader>(json['reader']);
	if (reader != null) {
		settingEntity.reader = reader;
	}
	final String? auth = jsonConvert.convert<String>(json['auth']);
	if (auth != null) {
		settingEntity.auth = auth;
	}
	final String? deviceName = jsonConvert.convert<String>(json['device_name']);
	if (deviceName != null) {
		settingEntity.deviceName = deviceName;
	}
	final String? deviceNo = jsonConvert.convert<String>(json['device_no']);
	if (deviceNo != null) {
		settingEntity.deviceNo = deviceNo;
	}
	final int? normalCountdown = jsonConvert.convert<int>(json['normal_countdown']);
	if (normalCountdown != null) {
		settingEntity.normalCountdown = normalCountdown;
	}
	final int? fastCountdown = jsonConvert.convert<int>(json['fast_countdown']);
	if (fastCountdown != null) {
		settingEntity.fastCountdown = fastCountdown;
	}
	final int? slowCountdown = jsonConvert.convert<int>(json['slow_countdown']);
	if (slowCountdown != null) {
		settingEntity.slowCountdown = slowCountdown;
	}
	final String? index = jsonConvert.convert<String>(json['index']);
	if (index != null) {
		settingEntity.index = index;
	}
	return settingEntity;
}

Map<String, dynamic> $SettingEntityToJson(SettingEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['api_addr'] = entity.apiAddr;
	data['picApiAddr'] = entity.picApiAddr;
	data['faceApiAddr'] = entity.faceApiAddr;
	data['executable'] = entity.executable;
	data['psw'] = entity.psw;
	data['appKey'] = entity.appKey;
	data['commonUid'] = entity.commonUid;
	data['analysisBook'] = entity.analysisBook;
	data['analysisReader'] = entity.analysisReader;
	data['face'] = entity.face;
	data['kdApi'] = entity.kdApi;
	data['isUltra'] = entity.isUltra;
	data['canReturnIfOver'] = entity.canReturnIfOver;
	data['blockStart'] = entity.blockStart;
	data['blockCount'] = entity.blockCount;
	data['scanTime'] = entity.scanTime;
	data['scale1'] = entity.scale1;
	data['scale2'] = entity.scale2;
	data['translateX1'] = entity.translateX1;
	data['translateX2'] = entity.translateX2;
	data['translateY1'] = entity.translateY1;
	data['translateY2'] = entity.translateY2;
	data['publish_name'] = entity.publishName;
	data['web_socket_addr'] = entity.webSocketAddr;
	data['reader'] =  entity.reader?.map((v) => v.toJson()).toList();
	data['auth'] = entity.auth;
	data['device_name'] = entity.deviceName;
	data['device_no'] = entity.deviceNo;
	data['normal_countdown'] = entity.normalCountdown;
	data['fast_countdown'] = entity.fastCountdown;
	data['slow_countdown'] = entity.slowCountdown;
	data['index'] = entity.index;
	return data;
}

SettingEntityReader $SettingEntityReaderFromJson(Map<String, dynamic> json) {
	final SettingEntityReader settingEntityReader = SettingEntityReader();
	final String? readerIp = jsonConvert.convert<String>(json['readerIp']);
	if (readerIp != null) {
		settingEntityReader.readerIp = readerIp;
	}
	final String? addr = jsonConvert.convert<String>(json['addr']);
	if (addr != null) {
		settingEntityReader.addr = addr;
	}
	final String? ant = jsonConvert.convert<String>(json['ant']);
	if (ant != null) {
		settingEntityReader.ant = ant;
	}
	final String? lock = jsonConvert.convert<String>(json['lock']);
	if (lock != null) {
		settingEntityReader.lock = lock;
	}
	final String? doorNo = jsonConvert.convert<String>(json['doorNo']);
	if (doorNo != null) {
		settingEntityReader.doorNo = doorNo;
	}
	final int? state = jsonConvert.convert<int>(json['state']);
	if (state != null) {
		settingEntityReader.state = state;
	}
	return settingEntityReader;
}

Map<String, dynamic> $SettingEntityReaderToJson(SettingEntityReader entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['readerIp'] = entity.readerIp;
	data['addr'] = entity.addr;
	data['ant'] = entity.ant;
	data['lock'] = entity.lock;
	data['doorNo'] = entity.doorNo;
	data['state'] = entity.state;
	return data;
}